package com.horizon.wxapp.controller;

import com.horizon.wxapp.entity.Users;
import com.horizon.wxapp.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("users")
public class UsersController {

    @Autowired
    private UsersService usersService;

    @RequestMapping("getUser")
    public Users getUser(String nickName, String tel) {
        return usersService.getUser(nickName, tel);
    }

    @RequestMapping("addUser")
    public void addUser(@RequestBody Users user) {
        usersService.addUser(user);
    }
}
